// 付费课程
let request = require('../../../utils/request');

let requestApi = {

};

//获取账户信息
requestApi.getAccountInfo = (data, loading = true) => {
	return request({
		url: '/courseAccount/getAccount',
		data,
		loading,
	});
}
// 设置支付宝账号
requestApi.setAlipay = (data, loading = true) => {
	return request({
		url: '/courseAccount/setAlipay',
		method: 'POST',
		data,
		loading,
	});
}

//获取账户详情列表
requestApi.getAccounDetail = (data, loading = true) => {
	return request({
		url: '/courseAccountDetails/getList',
		data,
		loading,
	});
}

// 添加课程
requestApi.postAddCourse = (data, loading = true) => {
	return request({
		url: '/course/add',
		method: 'POST',
		data,
		loading,
	});
}

// 删除
requestApi.deleteCourse = (data) => {
	return request({
		url: '/course/del',
		data,
	});
}
// 下架
requestApi.shelvesCourse = (data) => {
	return request({
		url: '/course/shelves',
		data,
	});
}

// 课程列表
requestApi.getList = (data, loading = true) => {
	return request({
		url: '/course/getList',
		data,
		loading,
	});
}

// 修改课程信息
requestApi.updataCourseinfo = (data, loading = true) => {
	return request({
		url: '/course/update',
		method: 'POST',
		data,
		loading,
	});
}

// 提现
requestApi.postCashOut = (data, loading = true) => {
	return request({
		url: '/courseCashOut/cashOut',
		method: 'POST',
		data,
		loading,
	});
}

// 获取直播回放列表
requestApi.getLivePlayBack = (data, loading = true) => {
	return request({
		url: '/live/myLiveLogList',
		data,
		loading,
	});
}

// 获取提现明细
requestApi.getCashOutList = (data, loading = true) => {
	return request({
		url: '/courseCashOut/getCashOutDetailList',
		data,
		loading,
	});
}

// 修改课程价格
requestApi.updateCouresPrice = (data, loading = true) => {
	return request({
		url: '/course/updateAmt',
		method: 'POST',
		data,
	});
}

module.exports = requestApi;